//package com.openecommerce.service.impl;
//
//import java.util.Date;
//import java.util.List;
//
//import javax.annotation.Resource;
//
//import com.openecommerce.constants.CommonConstants;
//import com.openecommerce.domain.Customer;
//import com.openecommerce.domain.CustomerCreateEntity;
//import com.openecommerce.domain.CustomerQueryEntity;
//import com.openecommerce.domain.basic.Page;
//import com.openecommerce.persistence.CustomerMapper;
//import com.openecommerce.service.CustomerService;
//
///**
// * 提供对Customer对象进行增、删、查、修改等操作接口对象
// * 
// * @author exceed
// *
// */
//
//public class CustomerServiceImpl implements   CustomerService{
//	
//	@Resource
//	private CustomerMapper customerMapper;
//	
//	@Override
//	public int create(CustomerCreateEntity data) {
//		Customer customer = new Customer();
//		data.fillChildObject(customer);
//		customer.setCreateAt(new Date());
//		int result = customerMapper.insertSelective(customer);
//		return result;
//	}
//
//	@Override
//	public boolean update(Long customerId, CustomerCreateEntity data) {
//		Customer customer = new Customer();
//		data.fillChildObject(customer);
//		customer.setCustomerId(customerId);
//		customer.setUpdateAt(new Date());
//		int result = customerMapper.updateByPrimaryKeySelective(customer);
//		return result == 1?true:false;
//	}
//
//	@Override
//	public boolean delete(Long customerId) {
//		Customer customer = new Customer();
//		customer.setCustomerId(customerId);
//		customer.setStatus(CommonConstants.CommonStatus.DISABLE);
//		//logic delete
//		int result = customerMapper.updateByPrimaryKeySelective(customer);
//		return result == 1?true:false;
//	}
//
//	@Override
//	public Customer get(Long customerId) {
//		return customerMapper.selectByPrimaryKey(customerId);
//	}
//
//	@Override
//	public Page<Customer> getList(CustomerQueryEntity data,int currentPage,int onePageCount) {
//		Page<Customer> customerPage = new Page<Customer>();
//		int countRecord = customerMapper.selectCountByQueryEntity(data);
//		customerPage.setCountRecord(countRecord);
//		customerPage.setCurrentPage(currentPage);
//		customerPage.setOnePageCount(onePageCount);
//		customerPage.calculate();
//		List<Customer> list = customerMapper.selectListByQueryEntity(data, customerPage.getStartIndex(), customerPage.getOnePageCount());
//		customerPage.setList(list);
//		return customerPage;
//	}
//	
//
//	
//}
